import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from 'unplugin-vue-components/resolvers';

import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
//  base:'/user/',
  base:'/pc/',
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()],
    })],
  resolve: {
    // Vite路径别名配置
    alias: {
      '@': path.resolve('./src')
    }
  },
  server:{
    port: 3000,
    host:'0.0.0.0',
    proxy: {
      '/api': {
        target: 'http://192.168.2.93:8080',	//实际请求地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    }
  }

})
